#!/usr/bin/env python
# -*- coding:utf-8 -*-
from django import forms
from django.forms import widgets


class DateTimePickerInput(forms.TextInput):
    template_name = 'stark/forms/widgets/datetime_picker.html'


class StarkRadioSelect(widgets.ChoiceWidget):
    input_type = 'radio'
    template_name = 'stark/forms/widgets/radio.html'
    option_template_name = 'stark/forms/widgets/radio_option.html'

    def build_attrs(self, base_attrs, extra_attrs=None):
        attrs = super().build_attrs(base_attrs, extra_attrs)
        origin = attrs.get('class')
        attrs['class'] = origin + ' clearfix' if origin else 'clearfix'
        return attrs
